{{include file = "layouts/operation/header.tpl"}}
<div class="jifensq">
	<div class="jifensq-top column1080">
    	 <div class="jifensq-top-l f_l">
         	<img src="public/operation/photo/sq-suer-i.png">
         </div>
         <div class="jifensq-top-r f_l">
         	<h4>Apply rules</h4>
            <p>
            1,You should be the Member of our site.<br>
			2,You need shopping through our site.<br>
			3,Please fill the application seriously.<br>
			4,The points will reach you after the deal close.<br>
			5,After submit the application, please pay attention to the order
			 progress and our customer service will check it for you manually,
			  any query please leave a message for your application.<br>
			6,After confirmation, the points will be sent to your account automatically within a week.<br>
            </p>
         </div>
    </div>
    <div class="jifensq-dow">
    	<h3>My application</h3>
        <p>I'm <font id="username">{{$username}}</font>, I now apply to items I purchased Points:</p>
        <form id="form" class="pointsapplication" >
        	<textarea style="width:100%; height:140px; border:1px solid #ccc; border-radius:4px;" name="content" id="content"></textarea><br>
			<input type="button" id="submitBtn">
        </form>
    </div>   
</div> 
{{include file = "layouts/operation/footer.tpl"}}


<script>

    $().ready(function(){
        $("[href^='#']").click(function (){location.hash=$(this).attr("href"); return false;});
        $('#myTab a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
        })

        $("#submitBtn").click(function(){
            var username = $("#username").html();
            if(!username){
                alert("please login first");
                return;
            }
            var content = $("#content").val();
            if(!content||content.trim().length<1){
                alert("apply content can't be null");
                return;
            }
            $.ajax({
                type: 'POST',
                url: '{{$smarty.const.WEBSITE_URL}}applypoints/submitContent',
                data: $('#form').serialize(),
                success: function(data){
                    alert("success");
                }

            });
        });
    });

</script>